import request from "@/utils/requests";
// 商品管理
const // 显示上架商品
  goodsApi = async (data) =>
    await request("/goods", {
      method: "GET",
      data,
    }),
  // 添加商品
  goodsAddApi = async (data) =>
    await request("/admin/goods/add", {
      method: "POST",
      headers: {
        "Content-Type": "multipart/form-data",
      },
      data,
    }),
  // 修改商品
  goodsEditApi = async (data) =>
    await request("/admin/goods/edit", {
      method: "PUT",
      data,
    }),
  // 下架&上架商品
  goodsOutApi = async (data) =>
    await request("/admin/goods/out", {
      method: "PUT",
      data,
    }),
  // 显示下架商品
  goodsShelfApi = async (data) =>
    await request("/admin/goods/shelf", {
      method: "GET",
      data,
    }),
  classifyApi = async (data) =>
    await request("/classify/img", {
      method: "GET",
      data,
    });

export {
  goodsApi,
  goodsAddApi,
  goodsEditApi,
  goodsOutApi,
  goodsShelfApi,
  classifyApi,
};
